package com.ls.blog.api;

import com.ls.blog.entity.SysUser;
import com.ls.blog.exception.TokenNotFoundException;
import com.ls.blog.vo.Author;
import com.ls.blog.vo.UserInfo;
import com.ls.blog.vo.UserVo;

import java.util.List;

/**
 * @program: myblog
 * @author: lishun
 * @create: 2021-07-05 00:12
 **/
public interface SysUserService {

    /**
     * 根据id发现用户
     * @param authorId
     * @return
     */
    SysUser findSysUserById(Long authorId);


    /**
     * 根据用户名发现用户
     * @param username
     * @return
     */
    SysUser findByUsername(String username);

    /**
     * 用户注册
     * @param sysUser
     * @return
     */
    void register(SysUser sysUser) throws Exception;


    /**
     * 根据token获得当前用户
     */
    UserInfo currentUser(String token) throws TokenNotFoundException, Exception;

    Author getAuthorById(Long authorId);

    /**
     * 分页查询所有用户信息
     * @param current
     * @return
     */
    List<UserVo> findUserList(Long current,Long size  );
}
